.class Lrexsee/core/transportation/RexseeDownload$1;
.super Ljava/lang/Thread;
.source "RexseeDownload.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/core/transportation/RexseeDownload;->download(Lrexsee/core/transportation/DownloadFile;Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field private stop:Z

.field private final stopRunnable:Ljava/lang/Runnable;

.field final synthetic this$0:Lrexsee/core/transportation/RexseeDownload;

.field private final synthetic val$downloadFile:Lrexsee/core/transportation/DownloadFile;

.field private final synthetic val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

.field private final synthetic val$sourceUrl:Ljava/net/URL;


# direct methods
.method constructor <init>(Lrexsee/core/transportation/RexseeDownload;Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;Lrexsee/core/transportation/DownloadFile;Ljava/net/URL;)V
    .locals 1

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    iput-object p2, p0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    iput-object p3, p0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    iput-object p4, p0, Lrexsee/core/transportation/RexseeDownload$1;->val$sourceUrl:Ljava/net/URL;

    .line 129
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    .line 130
    const/4 v0, 0x0

    iput-boolean v0, p0, Lrexsee/core/transportation/RexseeDownload$1;->stop:Z

    .line 131
    new-instance v0, Lrexsee/core/transportation/RexseeDownload$1$1;

    invoke-direct {v0, p0, p2, p3}, Lrexsee/core/transportation/RexseeDownload$1$1;-><init>(Lrexsee/core/transportation/RexseeDownload$1;Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;Lrexsee/core/transportation/DownloadFile;)V

    iput-object v0, p0, Lrexsee/core/transportation/RexseeDownload$1;->stopRunnable:Ljava/lang/Runnable;

    return-void
.end method

.method static synthetic access$0(Lrexsee/core/transportation/RexseeDownload$1;Z)V
    .locals 0

    .prologue
    .line 130
    iput-boolean p1, p0, Lrexsee/core/transportation/RexseeDownload$1;->stop:Z

    return-void
.end method


# virtual methods
.method public run()V
    .locals 35

    .prologue
    .line 140
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v4, v0

    iget-object v4, v4, Lrexsee/core/transportation/RexseeDownload;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v4, v4, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    invoke-virtual {v4}, Lrexsee/core/application/RexseeApplication;->getTimeout()I

    move-result v4

    move v0, v4

    mul-int/lit16 v0, v0, 0x3e8

    move/from16 v33, v0

    .line 142
    .local v33, "timeout":I
    :try_start_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    move-object v4, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v5, v0

    iget-object v5, v5, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v6, v0

    iget-object v6, v6, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const/4 v7, -0x1

    const/4 v8, 0x0

    const/4 v9, 0x0

    const/4 v10, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->stopRunnable:Ljava/lang/Runnable;

    move-object v11, v0

    invoke-virtual/range {v4 .. v11}, Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;->run(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/Runnable;)V

    .line 143
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$sourceUrl:Ljava/net/URL;

    move-object v4, v0

    invoke-virtual {v4}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v34

    check-cast v34, Ljava/net/HttpURLConnection;

    .line 144
    .local v34, "urlConnection":Ljava/net/HttpURLConnection;
    invoke-static {}, Landroid/webkit/CookieManager;->getInstance()Landroid/webkit/CookieManager;

    move-result-object v22

    .line 145
    .local v22, "cookieManager":Landroid/webkit/CookieManager;
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    iget-object v4, v4, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, v22

    move-object v1, v4

    invoke-virtual {v0, v1}, Landroid/webkit/CookieManager;->getCookie(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v20

    .line 146
    .local v20, "cookie":Ljava/lang/String;
    if-eqz v20, :cond_0

    .line 147
    const-string v4, "Cookie"

    move-object/from16 v0, v34

    move-object v1, v4

    move-object/from16 v2, v20

    invoke-virtual {v0, v1, v2}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 150
    :cond_0
    const-string v4, "User-Agent"

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v5, v0

    iget-object v5, v5, Lrexsee/core/transportation/RexseeDownload;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v5}, Lrexsee/core/browser/Browser;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v5

    invoke-virtual {v5}, Landroid/webkit/WebSettings;->getUserAgentString()Ljava/lang/String;

    move-result-object v5

    move-object/from16 v0, v34

    move-object v1, v4

    move-object v2, v5

    invoke-virtual {v0, v1, v2}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 151
    const-string v4, "GET"

    move-object/from16 v0, v34

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V

    .line 152
    const/4 v4, 0x1

    move-object/from16 v0, v34

    move v1, v4

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setDoOutput(Z)V

    .line 153
    move-object/from16 v0, v34

    move/from16 v1, v33

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    .line 154
    move-object/from16 v0, v34

    move/from16 v1, v33

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    .line 155
    invoke-virtual/range {v34 .. v34}, Ljava/net/HttpURLConnection;->connect()V

    .line 156
    invoke-virtual/range {v22 .. v22}, Landroid/webkit/CookieManager;->acceptCookie()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 158
    const/16 v23, 0x0

    .line 159
    .local v23, "cookieVal":Ljava/lang/String;
    const/16 v21, 0x0

    .line 160
    .local v21, "cookieKey":Ljava/lang/String;
    const-string v30, ""

    .line 161
    .local v30, "sessionCookie":Ljava/lang/String;
    const/16 v27, 0x1

    .local v27, "i":I
    :goto_0
    move-object/from16 v0, v34

    move/from16 v1, v27

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->getHeaderFieldKey(I)Ljava/lang/String;

    move-result-object v21

    if-nez v21, :cond_4

    .line 168
    const-string v4, ""

    move-object/from16 v0, v30

    move-object v1, v4

    if-eq v0, v1, :cond_1

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    iget-object v4, v4, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, v22

    move-object v1, v4

    move-object/from16 v2, v23

    invoke-virtual {v0, v1, v2}, Landroid/webkit/CookieManager;->setCookie(Ljava/lang/String;Ljava/lang/String;)V

    .line 170
    .end local v21    # "cookieKey":Ljava/lang/String;
    .end local v23    # "cookieVal":Ljava/lang/String;
    .end local v27    # "i":I
    .end local v30    # "sessionCookie":Ljava/lang/String;
    :cond_1
    const-string v4, "Content-Disposition"

    move-object/from16 v0, v34

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v26

    .line 171
    .local v26, "filename":Ljava/lang/String;
    if-eqz v26, :cond_2

    .line 172
    const-string v4, "filename="

    move-object/from16 v0, v26

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v29

    .line 173
    .local v29, "part":[Ljava/lang/String;
    move-object/from16 v0, v29

    array-length v0, v0

    move v4, v0

    const/4 v5, 0x1

    if-le v4, v5, :cond_2

    .line 174
    const/4 v4, 0x1

    aget-object v4, v29, v4

    const-string v5, ";"

    invoke-virtual {v4, v5}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    const/4 v5, 0x0

    aget-object v26, v4, v5

    .line 175
    invoke-virtual/range {v26 .. v26}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_2

    .line 176
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    new-instance v5, Ljava/lang/StringBuilder;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v6, v0

    iget-object v6, v6, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const/4 v7, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v8, v0

    iget-object v8, v8, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const-string v9, "/"

    invoke-virtual {v8, v9}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v8

    invoke-virtual {v6, v7, v8}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, "/"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    move-object v0, v5

    move-object/from16 v1, v26

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    iput-object v5, v4, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    .line 180
    .end local v29    # "part":[Ljava/lang/String;
    :cond_2
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v4, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v5, v0

    iget-object v5, v5, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    # invokes: Lrexsee/core/transportation/RexseeDownload;->getDownloadFile(Ljava/lang/String;)Ljava/io/File;
    invoke-static {v4, v5}, Lrexsee/core/transportation/RexseeDownload;->access$0(Lrexsee/core/transportation/RexseeDownload;Ljava/lang/String;)Ljava/io/File;

    move-result-object v32

    .line 181
    .local v32, "targetFile":Ljava/io/File;
    if-nez v32, :cond_6

    .line 182
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    move-object v4, v0

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, -0x3

    const/4 v8, 0x0

    const/4 v9, 0x0

    const-string v10, "Invalid target path."

    const/4 v11, 0x0

    invoke-virtual/range {v4 .. v11}, Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;->run(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/Runnable;)V

    .line 214
    .end local v20    # "cookie":Ljava/lang/String;
    .end local v22    # "cookieManager":Landroid/webkit/CookieManager;
    .end local v26    # "filename":Ljava/lang/String;
    .end local v32    # "targetFile":Ljava/io/File;
    .end local v34    # "urlConnection":Ljava/net/HttpURLConnection;
    :cond_3
    :goto_1
    return-void

    .line 162
    .restart local v20    # "cookie":Ljava/lang/String;
    .restart local v21    # "cookieKey":Ljava/lang/String;
    .restart local v22    # "cookieManager":Landroid/webkit/CookieManager;
    .restart local v23    # "cookieVal":Ljava/lang/String;
    .restart local v27    # "i":I
    .restart local v30    # "sessionCookie":Ljava/lang/String;
    .restart local v34    # "urlConnection":Ljava/net/HttpURLConnection;
    :cond_4
    const-string v4, "set-cookie"

    move-object/from16 v0, v21

    move-object v1, v4

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_5

    .line 163
    move-object/from16 v0, v34

    move/from16 v1, v27

    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->getHeaderField(I)Ljava/lang/String;

    move-result-object v23

    .line 164
    const/4 v4, 0x0

    const-string v5, ";"

    move-object/from16 v0, v23

    move-object v1, v5

    invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v5

    move-object/from16 v0, v23

    move v1, v4

    move v2, v5

    invoke-virtual {v0, v1, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v23

    .line 165
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-static/range {v30 .. v30}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object v0, v4

    move-object/from16 v1, v23

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ";"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v30

    .line 161
    :cond_5
    add-int/lit8 v27, v27, 0x1

    goto/16 :goto_0

    .line 185
    .end local v21    # "cookieKey":Ljava/lang/String;
    .end local v23    # "cookieVal":Ljava/lang/String;
    .end local v27    # "i":I
    .end local v30    # "sessionCookie":Ljava/lang/String;
    .restart local v26    # "filename":Ljava/lang/String;
    .restart local v32    # "targetFile":Ljava/io/File;
    :cond_6
    new-instance v25, Ljava/io/FileOutputStream;

    move-object/from16 v0, v25

    move-object/from16 v1, v32

    invoke-direct {v0, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 186
    .local v25, "fileOutput":Ljava/io/FileOutputStream;
    invoke-virtual/range {v34 .. v34}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v28

    .line 187
    .local v28, "inputStream":Ljava/io/InputStream;
    invoke-virtual/range {v34 .. v34}, Ljava/net/HttpURLConnection;->getContentLength()I

    move-result v8

    .line 188
    .local v8, "totalSize":I
    const/4 v9, 0x0

    .line 189
    .local v9, "downloadedSize":I
    const/16 v4, 0x400

    move v0, v4

    new-array v0, v0, [B

    move-object/from16 v18, v0

    .line 190
    .local v18, "buffer":[B
    const/16 v19, 0x0

    .line 191
    .local v19, "bufferLength":I
    :goto_2
    move-object/from16 v0, v28

    move-object/from16 v1, v18

    invoke-virtual {v0, v1}, Ljava/io/InputStream;->read([B)I

    move-result v19

    if-lez v19, :cond_7

    move-object/from16 v0, p0

    iget-boolean v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->stop:Z

    move v4, v0

    if-eqz v4, :cond_8

    .line 196
    :cond_7
    invoke-virtual/range {v28 .. v28}, Ljava/io/InputStream;->close()V

    .line 197
    invoke-virtual/range {v25 .. v25}, Ljava/io/FileOutputStream;->close()V

    .line 198
    invoke-virtual/range {v34 .. v34}, Ljava/net/HttpURLConnection;->disconnect()V

    .line 199
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->stop:Z

    move v4, v0

    if-nez v4, :cond_3

    .line 200
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    move-object v4, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v5, v0

    iget-object v5, v5, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v6, v0

    iget-object v6, v6, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const/4 v7, 0x1

    const/4 v10, 0x0

    const/4 v11, 0x0

    invoke-virtual/range {v4 .. v11}, Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;->run(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/Runnable;)V

    .line 201
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v4, v0

    iget-object v4, v4, Lrexsee/core/transportation/RexseeDownload;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v4, v4, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v5, "onDownloadFinished"

    const/4 v6, 0x2

    new-array v6, v6, [Ljava/lang/String;

    const/4 v7, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v8, v0

    .end local v8    # "totalSize":I
    iget-object v8, v8, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    aput-object v8, v6, v7

    const/4 v7, 0x1

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v8, v0

    iget-object v8, v8, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    aput-object v8, v6, v7

    invoke-virtual {v4, v5, v6}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    goto/16 :goto_1

    .line 203
    .end local v9    # "downloadedSize":I
    .end local v18    # "buffer":[B
    .end local v19    # "bufferLength":I
    .end local v20    # "cookie":Ljava/lang/String;
    .end local v22    # "cookieManager":Landroid/webkit/CookieManager;
    .end local v25    # "fileOutput":Ljava/io/FileOutputStream;
    .end local v26    # "filename":Ljava/lang/String;
    .end local v28    # "inputStream":Ljava/io/InputStream;
    .end local v32    # "targetFile":Ljava/io/File;
    .end local v34    # "urlConnection":Ljava/net/HttpURLConnection;
    :catch_0
    move-exception v4

    move-object/from16 v31, v4

    .line 204
    .local v31, "ste":Ljava/net/SocketTimeoutException;
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->stop:Z

    move v4, v0

    if-nez v4, :cond_3

    .line 205
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    move-object v10, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    iget-object v11, v4, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    iget-object v12, v4, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const/4 v13, -0x2

    const/4 v14, 0x0

    const/4 v15, 0x0

    invoke-static/range {v33 .. v33}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v16

    const/16 v17, 0x0

    invoke-virtual/range {v10 .. v17}, Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;->run(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/Runnable;)V

    .line 206
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v4, v0

    iget-object v4, v4, Lrexsee/core/transportation/RexseeDownload;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v4, v4, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v5, "onDownloadTimeout"

    const/4 v6, 0x2

    new-array v6, v6, [Ljava/lang/String;

    const/4 v7, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v8, v0

    iget-object v8, v8, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    aput-object v8, v6, v7

    const/4 v7, 0x1

    invoke-static/range {v33 .. v33}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v8

    aput-object v8, v6, v7

    invoke-virtual {v4, v5, v6}, Lrexsee/core/browser/clazz/EventList;->run(Ljava/lang/String;[Ljava/lang/String;)V

    goto/16 :goto_1

    .line 192
    .end local v31    # "ste":Ljava/net/SocketTimeoutException;
    .restart local v8    # "totalSize":I
    .restart local v9    # "downloadedSize":I
    .restart local v18    # "buffer":[B
    .restart local v19    # "bufferLength":I
    .restart local v20    # "cookie":Ljava/lang/String;
    .restart local v22    # "cookieManager":Landroid/webkit/CookieManager;
    .restart local v25    # "fileOutput":Ljava/io/FileOutputStream;
    .restart local v26    # "filename":Ljava/lang/String;
    .restart local v28    # "inputStream":Ljava/io/InputStream;
    .restart local v32    # "targetFile":Ljava/io/File;
    .restart local v34    # "urlConnection":Ljava/net/HttpURLConnection;
    :cond_8
    const/4 v4, 0x0

    :try_start_1
    move-object/from16 v0, v25

    move-object/from16 v1, v18

    move v2, v4

    move/from16 v3, v19

    invoke-virtual {v0, v1, v2, v3}, Ljava/io/FileOutputStream;->write([BII)V

    .line 193
    add-int v9, v9, v19

    .line 194
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    move-object v4, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v5, v0

    iget-object v5, v5, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v6, v0

    iget-object v6, v6, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const/4 v7, 0x0

    const/4 v10, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->stopRunnable:Ljava/lang/Runnable;

    move-object v11, v0

    invoke-virtual/range {v4 .. v11}, Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;->run(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/Runnable;)V
    :try_end_1
    .catch Ljava/net/SocketTimeoutException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto/16 :goto_2

    .line 208
    .end local v8    # "totalSize":I
    .end local v9    # "downloadedSize":I
    .end local v18    # "buffer":[B
    .end local v19    # "bufferLength":I
    .end local v20    # "cookie":Ljava/lang/String;
    .end local v22    # "cookieManager":Landroid/webkit/CookieManager;
    .end local v25    # "fileOutput":Ljava/io/FileOutputStream;
    .end local v26    # "filename":Ljava/lang/String;
    .end local v28    # "inputStream":Ljava/io/InputStream;
    .end local v32    # "targetFile":Ljava/io/File;
    .end local v34    # "urlConnection":Ljava/net/HttpURLConnection;
    :catch_1
    move-exception v4

    move-object/from16 v24, v4

    .line 209
    .local v24, "e":Ljava/lang/Exception;
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->stop:Z

    move v4, v0

    if-nez v4, :cond_3

    .line 210
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$progressListener:Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;

    move-object v10, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    iget-object v11, v4, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v4, v0

    iget-object v12, v4, Lrexsee/core/transportation/DownloadFile;->path:Ljava/lang/String;

    const/4 v13, -0x3

    const/4 v14, 0x0

    const/4 v15, 0x0

    invoke-virtual/range {v24 .. v24}, Ljava/lang/Exception;->getLocalizedMessage()Ljava/lang/String;

    move-result-object v16

    const/16 v17, 0x0

    invoke-virtual/range {v10 .. v17}, Lrexsee/core/transportation/RexseeDownload$DownloadProgressListener;->run(Ljava/lang/String;Ljava/lang/String;IIILjava/lang/String;Ljava/lang/Runnable;)V

    .line 211
    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v4, v0

    iget-object v4, v4, Lrexsee/core/transportation/RexseeDownload;->mBrowser:Lrexsee/core/browser/Browser;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->this$0:Lrexsee/core/transportation/RexseeDownload;

    move-object v5, v0

    invoke-virtual {v5}, Lrexsee/core/transportation/RexseeDownload;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    new-instance v6, Ljava/lang/StringBuilder;

    move-object/from16 v0, p0

    iget-object v0, v0, Lrexsee/core/transportation/RexseeDownload$1;->val$downloadFile:Lrexsee/core/transportation/DownloadFile;

    move-object v7, v0

    iget-object v7, v7, Lrexsee/core/transportation/DownloadFile;->url:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v7, ":"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    move-object v0, v6

    move-object/from16 v1, v24

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v5, v6}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_1
.end method
